version: '3'

services:
  application:
    image: 'dou888311/deploy'
    container_name: application
    ports :
      - 80:80
    restart: always
    depends_on:
      - db
    environment:
      - SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/another_disk
      - SPRING_DATASOURCE_USERNAME=postgres
      - SPRING_DATASOURCE_PASSWORD=4471
      - SPRING_JPA_HIBERNATE_DDL_AUTO=update
          
  db:
    image: 'postgres:13.1-alpine'
    container_name: db
    ports : 
      - 5432:5432
    restart: always
    environment:
      - POSTGRES_DB=another_disk
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=4471